package com.example.wangtieying.firtest;

import java.io.File;

/**
 * Created by wangtieying on 16/7/25.
 */
public class DataCleanManager {
    public static void deleteFilesByDirectory(File file) {
        if (file == null) {
            return;
        }
        if (file.exists()) {
            if (file.isFile()) {
                file.delete();
            } else if (file.isDirectory()) {
                File files[] = file.listFiles();
                for (int i = 0; i < files.length; i++) {
                    deleteFilesByDirectory(files[i]);
                }
            }
            file.delete();
        }
    }
}
